Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E tests for Azure internal loadbalancer support, fix an issue for public IP resource deletion. #45473

Merged

Conversation

karataliu
Copy link
Contributor

What this PR does / why we need it:

Special notes for your reviewer:

  1. Add new Azure resource tag to Public IP resources to indicate kubernetes managed resources.
    Currently we determine whether the public IP resource should be deleted by looking at LoadBalancerIp property on spec. In the scenario 'Switching from external loadbalancer to internal loadbalancer with static IP', that value might have been updated for internal loadbalancer. So here we're to add an explicit tag for kubernetes managed resources.

  2. Merge cleanupPublicIP logic into cleanupLoadBalancer

Release note:
NONE

CC @brendandburns @colemickens

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 8, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @karataliu. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 8, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels May 8, 2017
@spiffxp
Copy link
Member

spiffxp commented May 8, 2017

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 8, 2017
@justinsb
Copy link
Member

/assign @colemickens for triage

/unassign @justinsb
/unassign @saad-ali

@colemickens
Copy link
Contributor

@karataliu I can understand that there would be a bug about orphaning a public IP when switching from External->Internal, but I don't understand what the tag is for... we should only ever be looking at resources that are prefixed with the service UUID... and that value doesn't change unless the Service is deleted and re-created, in which case the ServiceController is going to delete that IP config, etc, and then recreate it like new (except for the other edge case caused by ServiceController tracking these things by name, rather than UUID... but that's a separate issue). I'm confused about why we would ever be considering other resources such that we need to evaluate that tag.

@karataliu
Copy link
Contributor Author

Thanks for the comment.

A previous change has removed 'getPublicIPName' from util, and add one in azure_loadbalancer.go to figure out the potential user public IP resource:
ea23cab#diff-982393cb8bac49b84e87ca8807d4e5e8L195

I've updated this PR accordingly:

  1. Add the original getPulicIPName back to util, and rename the current one in azuer_loadbalancer.go to determinePublicIPName.
  2. Updated to use name comparison to determine public IP keeping logic to keep consistent.

@jdumars
Copy link
Member

jdumars commented Jun 7, 2017

/sig azure

@jdumars
Copy link
Member

jdumars commented Jun 7, 2017

/retest

@colemickens
Copy link
Contributor

@karataliu This LGTM. Do you plan to document this on kubernetes.github.io repo? It would be good, if you do, if you can mention that the PIP resource has to be in the same resource group as the cluster? (Unless I missed it, this all still looks to be oriented around resources "names" all in the context of a single RG.)

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2017
@k8s-github-robot k8s-github-robot added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jun 13, 2017
@colemickens
Copy link
Contributor

/assign @ixdy

@@ -1241,6 +1241,77 @@ var _ = framework.KubeDescribe("Services", func() {
framework.CheckReachabilityFromPod(true, normalReachabilityTimeout, namespace, acceptPodName, svcIP)
framework.CheckReachabilityFromPod(true, normalReachabilityTimeout, namespace, dropPodName, svcIP)
})

It("should be able to create an internal type load balancer [Slow]", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put Azure in the name, since this is an Azure-only test?

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 14, 2017
@karataliu
Copy link
Contributor Author

@ixdy update pushed.

@karataliu
Copy link
Contributor Author

@colemickens Yes, current implementation would require the public IP resource to be in the same resource group of the cluster. I'm to prepare the doc update PR later.

@karataliu
Copy link
Contributor Author

@colemickens Please help review: kubernetes/website#4082

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 14, 2017

@karataliu: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
Jenkins GCE etcd3 e2e 4f7153b7beca9767b1666e6946bd4e7f87f47e39 link @k8s-bot gce etcd3 e2e test this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ixdy
Copy link
Member

ixdy commented Jun 14, 2017

/approve

Thanks! Can you please squash your commits, too?

@ixdy
Copy link
Member

ixdy commented Jun 14, 2017

I don't think e2e tests need a tracking issue.
/approve no-issue

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 14, 2017
@karataliu karataliu force-pushed the AzureInternalLoadBalancerE2E branch from 70f375f to f8ae27d Compare June 15, 2017 03:39
@karataliu
Copy link
Contributor Author

squash commit pushed. thanks.

@ixdy
Copy link
Member

ixdy commented Jun 21, 2017

/lgtm
/release-note-none

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Jun 21, 2017
@ixdy ixdy removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jun 21, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: colemickens, ixdy, karataliu

Associated issue requirement bypassed by: ixdy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@ixdy
Copy link
Member

ixdy commented Jun 21, 2017

sorry for delay; should this go into 1.7?

@karataliu
Copy link
Contributor Author

Thanks for update. I'd suggest making this in v1.7 . The previous PR#43510 for Azure internal LoadBalancer support is new in v1.7, and this one brings e2e case and bug fix.

@ixdy ixdy added this to the v1.7 milestone Jun 21, 2017
@ixdy
Copy link
Member

ixdy commented Jun 21, 2017

ok, tagging it as v1.7. @kubernetes/kubernetes-release-managers @dchen1107

@ixdy
Copy link
Member

ixdy commented Jun 21, 2017

@karataliu is there an issue associated with the bug this is fixing?

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 0f0e017 into kubernetes:master Jun 21, 2017
@karataliu
Copy link
Contributor Author

@ixdy no issue created yet, the origin feature issue is here: #38901

Shall I create one? Recap the bug description here based on fixups:

For external LoadBalancer feature on Azure, if a user exposes a Kubernetes service with LoadBalancer type, a new public IP resource will be created. And when the service got deleted, the public IP resource should also be deleted.

In #42034, we supported user specified IP for LoadBalancer on Azure, that is, a user could provision a public IP resource at first, and then specify it as the LoadBalancerIP value in service spec. In this case, when the service got deleted, it will not delete the user provided public IP.

Currently the logic for determining whether the public IP resource should be deleted is by checking whether LoadBalancerIP value in spec is empty. This becomes a issue after we later introduced internal LoadBalancer support in #43510. When a user switches from external LoadBalancer to internal LoadBalancer with static IP, we are not able to tell whether the public IP resource should be deleted, since the LoadBalancerIP value is overrided by the internal LoadBalancer's service spec.

The key thing is how to identify a public IP resource is managed or not. One solution could be determine by the name, since the managed public IPs will have conventional naming, which includes cluster name and service uuid.

@karataliu karataliu deleted the AzureInternalLoadBalancerE2E branch June 22, 2017 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet